<?php
if( !ini_get('safe_mode')){
set_time_limit(0);
}else{
ini_set('max_execution_time',10000);
}
require'connect.php';
$qqselect_sql="select * from qqlist where qd='2'";
$qqselect_result=mysql_query($qqselect_sql);
while($array=mysql_fetch_array($qqselect_result)){
$qq=$array['qq'];
$sid=$array['sid'];

$day = ceil((mktime(00,00,00,01,01,2015) - time())/86400);
if (!$day) $body = '元旦快乐';
elseif ($day > 0) $body = '距元旦还有' . $day . '天';
else {
$day = ceil((mktime(00,00,00,02,19,2015) - time())/86400);
if (!$day) $body = '新年快乐';
elseif ($day > 0) $body = '距春节还有' . $day . '天';
else {
$day = ceil((mktime(00,00,00,04,05,2015) - time())/86400);
if (!$day) $body = '清明快乐';
elseif ($day > 0) $body = '距清明还有' . $day . '天';
else {
$day = ceil((mktime(00,00,00,05,01,2015) - time())/86400);
if (!$day) $body = '劳动节快乐';
elseif ($day > 0) $body = '距劳动节还有' . $day . '天';
else {
$day = ceil((mktime(00,00,00,06,20,2015) - time())/86400);
if (!$day) $body = '端午节快乐';
elseif ($day > 0) $body = '距端午节还有' . $day . '天';
else {
$day = ceil((mktime(00,00,00,09,27,2015) - time())/86400);
if (!$day) $body = '中秋节快乐';
elseif ($day > 0) $body = '距中秋节还有' . $day . '天';
else {
$day = ceil((mktime(00,00,00,10,01,2015) - time())/86400);
if (!$day) $body = '国庆节快乐';
elseif ($day > 0) {
$body = '距国庆节还有' . $day . '天';
} else $body = date('Y年m月d日');
}
}
}
}
}
}
$body = $body . '.';

$ch = curl_init();
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Linux; U; Android 4.1.2; zh-cn; HW-HUAWEI_C8813Q/C8813QV100R001C92B199; 480*854; CTC/2.0) AppleWebKit/534.30 (KHTML, like Gecko) Mobile Safari/534.30');
curl_setopt($ch,CURLOPT_URL,'http://blog60.z.qq.com/mood/mood_add_exe.jsp?sid=' . $sid);
curl_setopt($ch,CURLOPT_POSTFIELDS,'content=' . $body . '&B_UID=' . $qq . '&mood_pic_url=http://imgcache.qq.com/qzone/em/e886.gif&album_id=&album_lloc=&album_sloc=&mb_url=&moodsign_id=A71212CCD82BCF71E13037F27276D001&moodsign_lock=&pageNo=1&c=0&come_from=mood_add_from_mood_exe&action=1');
$get=curl_exec($ch);
curl_close($ch);
}
?>